package com.fuluwa.infra.context;

import org.apache.shiro.SecurityUtils;

import com.fuluwa.domain.security.service.ShiroDbRealm.ShiroUser;

public class UserUtils {
	public static String getCurrentUserName() {
		Object principal = SecurityUtils.getSubject().getPrincipal();
		if(principal instanceof ShiroUser) {
			return ((ShiroUser)principal).loginName;
		}
		return (String) principal;
	}
}
